package com.cn.service.server.admin.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cn.bean.pojo.file.FileDetails;
import com.cn.mapper.dao.db1.FileUploadDao;
import com.cn.service.server.admin.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FileServiceImpl extends ServiceImpl<FileUploadDao,FileDetails> implements FileService {
    @Autowired(required = false)
    private FileUploadDao fileUploadDao;
    @Override
    public int uploadFile(FileDetails fileDetails) {
         Boolean a= fileUploadDao.insertScxx(fileDetails);
         if (a){
             return 1;
         }
        return 0;
    }

    @Override
    public List<FileDetails> selectUpload(FileDetails fileDetails) {
        return fileUploadDao.selectUpload(fileDetails);
    }

    @Override
    public int delScxx(int id) {
        Boolean x=fileUploadDao.delScxx(id);
        if (x){
            return 1;
        }
        return 0;
    }

    @Override
    public List<FileDetails> selectCf(String fileName) {
        return fileUploadDao.selectCf(fileName);
    }
}
